<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?>
<style type="text/css">
    .w{width:1000px; margin-left:auto; margin-right:auto;}
    .cart-title{width:600px;}
    .cart-price{width:100px;}
    .cart-qty{width:100px;}
    .cart-total{width:100px;}
    .cart-oprate{width:100px;}
</style>

<div class="w cart">
    <table>
        <thead>
            <tr>
                <th colspan="2" class="cart-title">商品</th>
                <th class="cart-price">单价</th>
                <th class="cart-qty">数量</th>
                <th class="cart-total">小计</th>
                <th class="cart-oprate">操作</th>
            </tr>
        </thead>
        <tbody>
            <?php foreach ($carts as $cart):?>
            <tr>
                <td></td>
                <td>
                    <p><?php echo anchor('product/'.$cart['product_id'], $cart['product_name'], 'title="'.$cart['product_name'].'"');?></p>
                    <?php foreach ($cart['options'] as $opt):?>
                    <p><?php echo $opt['option_name'].':'.$opt['option_value_name'];?></p>
                    <?php endforeach;?>
                </td>
                <td>11</td>
                <td><?php echo $cart['quantity']?></td>
                <td>11</td>
                <td><?php echo anchor('cart/delete/'.$cart['shopping_cart_id'], '删除')?></td>
            </tr>
            <?php endforeach;?>
        </tbody>
    </table>
</div>